<%@ Control Language="C#" %>
<%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %>
<%@ Register TagPrefix="CS" Namespace="CommunityServer.Controls" Assembly="CommunityServer.Controls" %>
<%@ Register TagPrefix="CSD" Namespace="CommunityServer.Discussions.Controls" Assembly="CommunityServer.Discussions" %>
<%@ Register TagPrefix="TWC" Namespace="Telligent.Web.UI" Assembly="Telligent.Web.UI" %>
<%@ Import Namespace="CommunityServer" %>
<%@ Import Namespace="CommunityServer.Components" %>

<script language = "javascript">

    var oneTimeOnly = false;
    function SelectRecent()
    {
        if(!oneTimeOnly)
        {
            <%= SearchCallBack.ClientID %>.Callback(null);
            oneTimeOnly = true;
        }
    }

</script>

<script language="C#" runat="server">

bool CanSeeUserPoints()
{
	CSContext csContext = CSContext.Current;

	if (!csContext.SiteSettings.EnablePointSystem)
		return false;

	switch (csContext.SiteSettings.PointsUserDisplayLevel)
	{
		case DisplayLevel.None:
			return false;
		case DisplayLevel.Everyone:
			return true;
		case DisplayLevel.AdministratorsAndModerators:
			return (csContext.User.IsAdministrator || csContext.User.IsModerator);
		default:
			return false;
	}
}
</script>

<div class="CommonContentArea">
	<CS:AdPart runat = "Server" contentname="StandardTop" ID="Adpart1">
	    <CS:Ads Zone="StandardTop" runat="server" id="Ads1" />
	</CS:AdPart>
	<div class="CommonContent">
	
		<table cellspacing="0" cellpadding="0" border="0" width="100%">
			<tr valign="middle">
				<td style="padding-top: 8px; padding-bottom: 8px;">
					<CS:UserAvatar OverrideUser="true" Visible="True" id="Avatar" runat="server" PadImage="False" />
				</td>
				<td width="100%">
					<h2 class="CommonProfileTitle"><asp:Literal id="Username" runat="server" /></h2>
				</td>
			</tr>
		</table>
		
		<TWC:TabbedPanes id="ProfileTabs" runat="server"
			PanesCssClass="CommonPane"
			TabSetCssClass="CommonPaneTabSet"
			TabCssClasses="CommonPaneTab,CommonPaneTab1,CommonPaneTab2"
			TabSelectedCssClasses="CommonPaneTabSelected,CommonPaneTabSelected1,CommonPaneTabSelected2"
			TabHoverCssClasses="CommonPaneTabHover,CommonPaneTabHover1,CommonPaneTabHover2"
			>
		<TWC:TabbedPane runat="server">
			<Tab><CS:ResourceControl runat="server" ResourceName="ViewUserProfile_Tab_Profile" /></Tab>
			<Content>
		
			<p>
			<div class="CommonGroupedContentArea">
			<table cellpadding="0" cellspacing="0" border="0" width="100%">
				<tr id="ManageUser" visible="false" runat="server">
					<td class="CommonFormFieldName" width="35%">
						<CS:ResourceControl runat="server" ResourceName="Admin_CommonTerms_Manage" id="Resourcelabel1"/>
					</td>
					<td class="CommonFormField" width="65%">
						<a href='<%=Globals.GetSiteUrls().ControlPanelUserEdit( CSContext.Current.UserID ) %>'><CS:ResourceControl runat="server" ResourceName="Admin_CommonTerms_Manage" id="Resourcelabel2"/></a>            
					</td>
				</tr>
				<tr>
					<td class="CommonFormFieldName" width="35%">
						<CS:ResourceControl runat="server" ResourceName="ViewUserProfile_Joined" id="Resourcelabel3"/>
					</td>
					<td class="CommonFormField" width="65%">
						<asp:Literal id="JoinedDate" runat="server" />
					</td>
				</tr>
				<tr>
					<td class="CommonFormFieldName">
						<CS:ResourceControl runat="server" ResourceName="ViewUserProfile_LastVisit" id="Resourcelabel5"/>
					</td>
					<td class="CommonFormField">
						<asp:Literal id="LastActivityDate" runat="server" />
					</td>
				</tr>
				<tr>
					<td class="CommonFormFieldName">
						<CS:ResourceControl runat="server" ResourceName="ViewUserProfile_Timezone" id="Resourcelabel6"/>
						<div class="CommonFormFieldDescription"><CS:ResourceControl runat="server" ResourceName="ViewUserProfile_TimezoneDescription" id="Resourcelabel7"/></div>
					</td>
					<td class="CommonFormField">
						<asp:Literal id="TimeZone" runat="server" /> GMT
					</td>
				</tr>
				<tr>
					<td class="CommonFormFieldName">
						<CS:ResourceControl runat="server" ResourceName="ViewUserProfile_Location" id="Resourcelabel8"/>
					</td>
					<td class="CommonFormField">
						<asp:Literal id="Location" runat="server" />
					</td>
				</tr>
				<tr>
					<td class="CommonFormFieldName">
						<CS:ResourceControl runat="server" ResourceName="ViewUserProfile_Occupation" id="Resourcelabel9"/>
					</td>
					<td class="CommonFormField">
						<asp:Literal id="Occupation" runat="server" />
					</td>
				</tr>
				<tr>
					<td class="CommonFormFieldName">
						<CS:ResourceControl runat="server" ResourceName="ViewUserProfile_Interests" id="Resourcelabel10"/>
					</td>
					<td class="CommonFormField">
						<asp:Literal id="Interests" runat="server" />
					</td>
				</tr>
				<tr>
					<td class="CommonFormFieldName">
						<CS:ResourceControl runat="server" ResourceName="ViewUserProfile_Birthday" id="Resourcelabel30"/>
					</td>
					<td class="CommonFormField">
						<asp:Literal id="Birthday" runat="server" />&nbsp;<asp:Literal id="Age" runat="server" />
					</td>
				</tr>
				<tr>
					<td class="CommonFormFieldName">
						<CS:ResourceControl runat="server" ResourceName="ViewUserProfile_WebAddress" id="Resourcelabel11"/>
					</td>
					<td class="CommonFormField">
						<asp:HyperLink id="WebURL" Target="_blank" runat="server" />
					</td>
				</tr>
				<tr>
					<td class="CommonFormFieldName">
						<CS:ResourceControl runat="server" ResourceName="ViewUserProfile_BlogAddress" id="Resourcelabel12"/>
					</td>
					<td class="CommonFormField">
						<asp:HyperLink id="BlogURL" Target="_blank" runat="server" />
					</td>
				</tr>
				<tr>
					<td class="CommonFormFieldName">
						<CS:ResourceControl runat="server" ResourceName="ViewUserProfile_GalleryAddress" id="Resourcecontrol2"/>
					</td>
					<td class="CommonFormField">
						<asp:HyperLink id="GalleryURL" Target="_blank" runat="server" />
					</td>
				</tr>	
			</table>
		</div>

		<div class="CommonGroupedContentArea">
			<h3 class="CommonSubTitle"><CS:ResourceControl runat="server" ResourceName="ViewUserProfile_AvatarPostSignature" id="Resourcelabel14" /></h3>
			<table cellpadding="0" cellspacing="0" border="0" width="100%">
				<tr>
					<td class="CommonFormFieldName">
						<CS:ResourceControl runat="server" ResourceName="ViewUserProfile_Signature" id="Resourcelabel17"/>
					</td>
					<td class="CommonFormField">
						<asp:Literal id="Signature" runat="server" />
					</td>
				</tr>
			</table>
		</div>

		<asp:PlaceHolder  ID="PrivateContactInformation" Runat="server" Visible="False">
		<div class="CommonGroupedContentArea">
			<h3 class="CommonSubTitle"><CS:ResourceControl runat="server" ResourceName="ViewUserProfile_Contact" id="Resourcelabel18" /></h3>
			<table cellpadding="0" cellspacing="0" border="0" width="100%" >
				<tr runat = "server" id = "PMArea">
					<td class="CommonFormFieldName" width="35%">
						<CS:ResourceControl runat="server" ResourceName="ViewUserProfile_PrivateMessage" id="Resourcecontrol1"/>
					</td>
					<td class="CommonFormField" width="65%">
						<asp:HyperLink id="PrivateMessage" runat="server" />
					</td>
				</tr>
			
				<tr>
					<td class="CommonFormFieldName" width="35%">
						<CS:ResourceControl runat="server" ResourceName="ViewUserProfile_Email" id="Resourcelabel19"/>
					</td>
					<td class="CommonFormField" width="65%">
						<CS:ModalLink id="Email" runat="server" Width="600" Height="420" />
					</td>
				</tr>
				<tr>
					<td class="CommonFormFieldName">
						<CS:ResourceControl runat="server" ResourceName="ViewUserProfile_MsnIm" id="Resourcelabel20"/>
					</td>
					<td class="CommonFormField">
						<asp:Literal id="MSNIM" runat="server" />
					</td>
				</tr>
				<tr>
					<td class="CommonFormFieldName">
						<CS:ResourceControl runat="server" ResourceName="ViewUserProfile_AolIm" id="Resourcelabel21"/>
					</td>
					<td class="CommonFormField">
						<asp:Literal id="AOLIM" runat="server" />
					</td>
				</tr>
				<tr>
					<td class="CommonFormFieldName">
						<CS:ResourceControl runat="server" ResourceName="ViewUserProfile_YahooIm" id="Resourcelabel22"/>
					</td>
					<td class="CommonFormField">
						<asp:Literal id="YahooIM" runat="server" />
					</td>
				</tr>
				<tr>
					<td class="CommonFormFieldName">
						<CS:ResourceControl runat="server" ResourceName="ViewUserProfile_IcqIm" id="Resourcelabel23"/>
					</td>
					<td class="CommonFormField">
						<asp:Literal id="ICQ" runat="server" />
					</td>
				</tr>
			</table>
		</div>
		</asp:PlaceHolder>

		</p>
		</Content>
		</TWC:TabbedPane>
		<TWC:TabbedPane runat="server">
		<Tab><CS:ResourceControl runat="server" ResourceName="ViewUserProfile_Tab_Bio" /></Tab>
		<Content>
			<h3 class="CommonSubTitle"><asp:Literal Runat="server" id="AboutBio" /></h3>
			<asp:Literal Runat="server" id="Bio" />
			
		</Content>
		</TWC:TabbedPane>
		<TWC:TabbedPane runat="server">
		<Tab OnClickClientFunction="SelectRecent"><CS:ResourceControl runat="server" ResourceName="ViewUserProfile_Tab_RecentPosts" /></Tab>
		<Content>
				<p>
		<div class="CommonGroupedContentArea">
			<h3 class="CommonSubTitle"><CS:ResourceControl runat="server" ResourceName="ViewUserProfile_PostStats" id="Resourcelabel24" /></h3>
						<CS:ResourceControl runat="server" ResourceName="ViewUserProfile_TotalPosts" id="Resourcelabel25"/>
						<asp:Literal id="TotalPosts" runat="server" /> <strong>//</strong>
						<CS:ResourceControl runat="server" ResourceName="ViewUserProfile_PostRank" id="Resourcelabel26"/>
						<asp:Literal id="Rank" runat="server" /> <strong>//</strong>
				<span id="PointsRow" runat="server" visible="false">
						<CS:ResourceControl runat="server" ResourceName="ViewUserProfile_Points" id="Resourcelabel27"/>
						<asp:Literal id="Points" runat="server" />
				</span>
		</div>
		
		<ComponentArt:CallBack id="SearchCallBack" CacheContent="false" runat="server" >
		 <Content>
				<asp:Repeater id="SearchRepeater" runat="Server" EnableViewState="false">
					<HeaderTemplate>
						<ul class="CommonSearchResultList">
					</HeaderTemplate>
					<ItemTemplate>
						<li>
						<div class="CommonSearchResultArea">
							<h4 class="CommonSearchResultName"><a href="<%# DataBinder.Eval(Container.DataItem, "Url") %>"><%# DataBinder.Eval(Container.DataItem, "Title") %></a></h4>
							<div class="CommonSearchResult">
								<%# Formatter.GetBodySummary(DataBinder.Eval(Container.DataItem, "BestMatch").ToString(),350, "", System.Drawing.Color.Black, System.Drawing.Color.Yellow) %>
							</div>
							<div class="CommonSearchResultDetails">
								<CS:ResourceLabel runat="server" ResourceName="SearchResults_PostTo" ID="Resourcelabel13"/>&nbsp;<asp:HyperLink Runat="server" ID = "SectionUrl" Text = '<%# DataBinder.Eval(Container.DataItem, "SectionName") %>' /> <a href ="<%# DataBinder.Eval(Container.DataItem, "ApplicationUrl") %>">(<%# DataBinder.Eval(Container.DataItem, "ApplicationType") %>)</a>&nbsp;<CS:ResourceLabel runat="server" ResourceName="SearchResults_By" ID="Resourcelabel15"/>&nbsp;<a href="<%# SiteUrls.Instance().UserProfile((string) DataBinder.Eval(Container.DataItem, "Username")) %>"><%# DataBinder.Eval(Container.DataItem, "Username") %></a>&nbsp;<CS:ResourceLabel runat="server" ResourceName="SearchResults_On" ID="Resourcelabel16"/>&nbsp;<%# DataBinder.Eval(Container.DataItem, "PostDate","{0:MMMM d, yyyy}") %>
							</div>
						</div>
						</li>
					</ItemTemplate>
					<FooterTemplate>
						</ul>
					</FooterTemplate>
				</asp:Repeater>
	    </Content>
	    <LoadingPanelClientTemplate>
	        Loading...<img src = "../utility/spinner.gif" />
	    </LoadingPanelClientTemplate>
	 </ComponentArt:CallBack>
				
				</p>
		</Content>
		</TWC:TabbedPane>
		<TWC:TabbedPane runat="server">
		<Tab><CS:ResourceControl runat="server" ResourceName="ViewUserProfile_Tab_Favorites" /></Tab>
		<Content>		

			<p>
				<h3 class="CommonSubTitle"><cs:resourcecontrol runat="server" resourcename="ViewUserProfile_SharedFavorites_Title" id="Resourcecontrol50" name="Resourcecontrol44"/></h3>
				<div class="CommonListArea">
				<h4 class="CommonListTitle"><cs:resourcecontrol runat="server" resourcename="EditProfile_FavoriteUsers_Title" id="Resourcecontrol44" name="Resourcecontrol44"/></h4>
				<cs:repeaterplusnone id="FavoriteUsers" runat="server">
					<headertemplate>
						<table cellpadding="0" cellspacing="0" border="0" width="100%">
							<thead>
							<tr>
								<th class="CommonListHeaderLeftMost"><cs:resourcecontrol runat="server" resourcename="EditProfile_FavoriteUsers_Username" id="Resourcecontrol45" name="Resourcecontrol45"/></th>
								<th class="CommonListHeader"><cs:resourcecontrol runat="server" resourcename="EditProfile_FavoriteUsers_TotalPosts" id="Resourcecontrol46" name="Resourcecontrol46"/></th>
								<th class="CommonListHeader"><cs:resourcecontrol runat="server" resourcename="EditProfile_FavoriteUsers_PostRank" id="Resourcecontrol47" name="Resourcecontrol47"/></th>
								<th class="CommonListHeader" runat="server" visible="<%# CanSeeUserPoints() %>"><cs:resourcecontrol runat="server" resourcename="EditProfile_FavoriteUsers_Points" id="Resourcecontrol48" name="Resourcecontrol48"/></th>
								<th class="CommonListHeader"><cs:resourcelabel runat="server" resourcename="EditProfile_FavoriteUsers_Actions" id="Resourcelabel4"/></th>
							</tr>
							</thead>
							<tbody>
					</headertemplate>
					<itemtemplate>
							<tr>
								<td class="CommonListCellLeftMost"><%# Formatter.FormatUsername((int)DataBinder.Eval(Container.DataItem, "UserID"), DataBinder.Eval(Container.DataItem, "Username").ToString(), false) %>&nbsp;</td>
								<td class="CommonListCell"><%# DataBinder.Eval(Container.DataItem, "TotalPosts") %>&nbsp;</td>
								<td class="CommonListCell"><%# ((Byte[])(DataBinder.Eval(Container.DataItem, "PostRank")))[0] %>&nbsp;</td>
								<td class="CommonListCell" runat="server" visible="<%# CanSeeUserPoints() %>"><%# DataBinder.Eval(Container.DataItem, "Points") %>&nbsp;</td>
								<td class="CommonListCell"><cs:userimagebuttons runat="server" mode="PrivateMessages" user='<%# (User) Container.DataItem %>' />&nbsp;</td>
							</tr>
					</itemtemplate>
					<footertemplate>
							</tbody>
						</table>
					</footertemplate>
					<nonetemplate>
							<tr>
								<td align="center" colspan="5" class="CommonListCellLeftMost"><cs:resourcecontrol runat="server" resourcename="ViewUserProfile_FavoriteUsers_None" id="Resourcecontrol49" name="Resourcecontrol49"/></td>
							</tr>
					</nonetemplate>
				</cs:repeaterplusnone>
				</div>
			</p>
			<p>
				<div class="CommonListArea">
				<h4 class="CommonListTitle"><cs:resourcecontrol runat="server" resourcename="EditProfile_FavoritePosts_Title" id="Resourcecontrol60" name="Resourcecontrol44"/></h4>
				<cs:repeaterplusnone id="FavoritePosts" runat="server">
					<headertemplate>
						<table cellpadding="0" cellspacing="0" border="0" width="100%">
							<thead>
							<tr>
								<th class="CommonListHeaderLeftMost"><cs:resourcecontrol runat="server" resourcename="EditProfile_FavoritePosts_Subject" id="Resourcecontrol64" name="Resourcecontrol45"/></th>
								<th class="CommonListHeader"><cs:resourcecontrol runat="server" resourcename="EditProfile_FavoritePosts_Excerpt" id="Resourcecontrol65" name="Resourcecontrol46"/></th>
							</tr>
							</thead>
							<tbody>
					</headertemplate>
					<itemtemplate>
							<tr>
								<td class="CommonListCellLeftMost"><a href="<%# ApplicationSet.Applications[((Post)Container.DataItem).Section.ApplicationType].Url((Post)Container.DataItem) %>"><%# DataBinder.Eval(Container.DataItem, "Subject") %></a>&nbsp;</td>
								<td class="CommonListCell"><%# DataBinder.Eval(Container.DataItem, "ForceExcerpt") %>&nbsp;</td>
							</tr>
					</itemtemplate>
					<footertemplate>
							</tbody>
						</table>
					</footertemplate>
					<nonetemplate>
							<tr>
								<td align="center" colspan="2" class="CommonListCellLeftMost"><cs:resourcecontrol runat="server" resourcename="ViewUserProfile_FavoritePosts_None" id="Resourcecontrol67" name="Resourcecontrol49"/></td>
							</tr>
					</nonetemplate>
				</cs:repeaterplusnone>
				</div>
			</p>
			<p>
				<div class="CommonListArea">
				<h4 class="CommonListTitle"><cs:resourcecontrol runat="server" resourcename="EditProfile_FavoriteSections_Title" id="Resourcecontrol61" name="Resourcecontrol44"/></h4>
				<cs:repeaterplusnone id="FavoriteSections" runat="server">
					<headertemplate>
						<table cellpadding="0" cellspacing="0" border="0" width="100%">
							<thead>
							<tr>
								<th class="CommonListHeaderLeftMost"><cs:resourcecontrol runat="server" resourcename="EditProfile_FavoriteSections_Name" id="Resourcecontrol62" name="Resourcecontrol45"/></th>
								<th class="CommonListHeader"><cs:resourcecontrol runat="server" resourcename="EditProfile_FavoriteSections_Description" id="Resourcecontrol63" name="Resourcecontrol46"/></th>
							</tr>
							</thead>
							<tbody>
					</headertemplate>
					<itemtemplate>
							<tr>
								<td class="CommonListCellLeftMost">
									<%# Container.DataItem.ToString().Substring(Container.DataItem.ToString().LastIndexOf(".") + 1) %>:
									<a href="<%# DataBinder.Eval(Container.DataItem, "Url") %>"><%# DataBinder.Eval(Container.DataItem, "Name") %></a>&nbsp;</td>
								<td class="CommonListCell"><%# DataBinder.Eval(Container.DataItem, "Description") %>&nbsp;</td>
							</tr>
					</itemtemplate>
					<footertemplate>
							</tbody>
						</table>
					</footertemplate>
					<nonetemplate>
							<tr>
								<td align="center" colspan="2" class="CommonListCellLeftMost"><cs:resourcecontrol runat="server" resourcename="ViewUserProfile_FavoriteSections_None" id="Resourcecontrol66" name="Resourcecontrol49"/></td>
							</tr>
					</nonetemplate>
				</cs:repeaterplusnone>
				</div>
			</p>
		</Content>
		</TWC:TabbedPane>
	</TWC:TabbedPanes>
	

	</div>
	<CS:AdPart runat = "Server" contentname="StandardBottom" ID="Adpart2">
	    <CS:Ads Zone="StandardBottom" runat="server" id="Ads3" />
	</CS:AdPart>

</div>


	
